﻿using System;
using System.Threading;
using Android.App;
using Android.Content;
using Android.Runtime;
using Android.Views;
using Android.Widget;
using Android.OS;
using GBU.Activities;

namespace GBU
{
    [Activity(Label = "GBU", MainLauncher = false, Icon = "@drawable/icon")]
    public class LoadingActivity : Activity
    {
        ProgressDialog progress;
        protected override void OnCreate(Bundle bundle)
        {
            base.OnCreate(bundle);

            //RequestWindowFeature(WindowFeatures.NoTitle);

            // Set our view from the "main" layout resource
            SetContentView(Resource.Layout.Loading);

            progress = ProgressDialog.Show(this, "Loading...", "GBU正在加载，请稍等……", true);

            new Thread(() =>
                {
                    Thread.Sleep(4 * 1000);
                    RunOnUiThread(() => progress.Dismiss());
                    Intent i=new Intent(this,typeof(CountDownActivity));
                    StartActivity(i);
                    this.Finish();
                }).Start();
        }
    }
}

